package sync

import (
	"gopkg.in/h2non/gentleman.v2"
	"promsync/progress/log"
)

type HttpNotify struct {
	Url string
}

func (httpNotify *HttpNotify) Notify() {
	cli := gentleman.New()
	re, err := cli.Post().URL(httpNotify.Url).Do()
	if err != nil {
		log.Log.Errorf("Notify请求失败: %s", err)
	}
	if !re.Ok {
		log.Log.Errorf("Notify请求错误: %s,%s", re.RawResponse.Status, re.Error)
	}

}
